* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none; /* 禁止文本选择 */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

:root {
    /* 亮色主题变量 */
    --primary-color: #4361ee;
    --primary-light: rgba(67, 97, 238, 0.1);
    --secondary-color: #6c757d;
    --background-color: rgba(248, 249, 250, 0.7); /* 半透明背景 */
    --card-bg-color: rgba(255, 255, 255, 0.7); /* 半透明卡片背景 */
    --text-color: #212529;
    --text-secondary: #6c757d;
    --border-color: rgba(233, 236, 239, 0.5); /* 半透明边框 */
    --border-radius: 12px;
    --header-height: 50px;
    --box-shadow: 0 10px 20px rgba(0, 0, 0, 0.06); /* 更轻的阴影 */
    --transition: all 0.3s ease;
    --gradient: linear-gradient(120deg, rgba(67, 97, 238, 0.8), rgba(58, 12, 163, 0.8)); /* 半透明渐变 */
    --backdrop-blur: 10px; /* 背景模糊效果 */
}

[data-theme="dark"] {
    /* 暗色主题变量 */
    --primary-color: #4361ee;
    --primary-light: rgba(67, 97, 238, 0.15);
    --secondary-color: #adb5bd;
    --background-color: rgba(18, 18, 18, 0.7); /* 半透明背景 */
    --card-bg-color: rgba(30, 30, 30, 0.7); /* 半透明卡片背景 */
    --text-color: #f8f9fa;
    --text-secondary: #adb5bd;
    --border-color: rgba(45, 45, 45, 0.5); /* 半透明边框 */
    --box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15); /* 更轻的阴影 */
    --gradient: linear-gradient(120deg, rgba(67, 97, 238, 0.8), rgba(114, 9, 183, 0.8)); /* 半透明渐变 */
}

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    transition: background-color 0.3s ease;
    padding: 0 20px;
    margin: 0 auto;
    max-width: 1200px;
}

/* 移除容器类，让各元素独立显示 */
.container, .dashboard {
    display: none; /* 不再使用这些容器 */
}

/* 头部样式 */
header {
    height: 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    position: relative;
    top: auto;
    left: auto;
    width: auto;
    z-index: 100;
    background-color: transparent;
    transition: var(--transition);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-radius: 0;
    border: none;
    box-shadow: none;
    max-width: 100%;
    margin: 10px 0;
}

.header-left, .header-right {
    display: flex;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
    min-width: 100px;
}

.logo {
    font-size: 24px;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    height: 30px;
}

.theme-toggle {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 20px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    position: relative;
}

.theme-toggle:hover {
    background-color: var(--primary-light);
}

.light-icon, .dark-icon {
    position: absolute;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.light-icon {
    opacity: 0;
    transform: rotate(90deg);
}

.dark-icon {
    opacity: 1;
}

[data-theme="dark"] .light-icon {
    opacity: 1;
    transform: rotate(0);
}

[data-theme="dark"] .dark-icon {
    opacity: 0;
    transform: rotate(-90deg);
}

/* 主内容区域 */
.main-content {
    flex: 1;
    padding: 0 20px 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.top-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 0;
}

/* 搜索框样式 */
.search-box {
    position: relative;
    width: 100%;
    max-width: 400px;
    margin: 0;
    display: flex;
    align-items: center;
}

.search-engine-icon {
    position: absolute;
    left: 15px;
    cursor: pointer;
    z-index: 2;
}

.search-icon {
    color: var(--secondary-color);
    font-size: 18px;
    transition: var(--transition);
}

.search-engine-icon:hover .search-icon {
    color: var(--primary-color);
    transform: scale(1.1);
}

/* 搜索引擎下拉菜单 */
.search-engine-dropdown {
    position: absolute;
    top: 45px;
    left: 0;
    width: 160px;
    background-color: var(--card-bg-color);
    border-radius: 10px;
    box-shadow: var(--box-shadow);
    display: none;
    z-index: 100;
    overflow: hidden;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(var(--backdrop-blur));
    -webkit-backdrop-filter: blur(var(--backdrop-blur));
}

.search-engine-dropdown.show {
    display: block;
    animation: fadeIn 0.2s ease;
}

.search-engine-item {
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: var(--transition);
}

.search-engine-item:hover {
    background-color: var(--primary-light);
}

.search-engine-item i {
    font-size: 18px;
    color: var(--primary-color);
}

.search-engine-item span {
    font-size: 14px;
    color: var(--text-color);
}

#search-input {
    flex: 1;
    height: 40px;
    padding: 0 50px 0 40px;
    border: 2px solid var(--border-color);
    border-radius: 20px;
    font-size: 15px;
    outline: none;
    transition: var(--transition);
    background-color: var(--card-bg-color);
    color: var(--text-color);
    backdrop-filter: blur(var(--backdrop-blur));
    -webkit-backdrop-filter: blur(var(--backdrop-blur));
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    cursor: text;
}

#search-button {
    position: absolute;
    right: 5px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

#search-button:hover {
    background: var(--gradient);
    transform: scale(1.05);
}

#search-button i {
    font-size: 18px;
}

#search-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* 每日一言 */
.daily-quote {
    background-color: var(--card-bg-color);
    border-radius: var(--border-radius);
    padding: 15px 20px;
    box-shadow: var(--box-shadow);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    transition: var(--transition);
    margin: 20px 0;
    backdrop-filter: blur(var(--backdrop-blur));
    -webkit-backdrop-filter: blur(var(--backdrop-blur));
}

.quote-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    position: relative;
    padding-left: 28px;
}

.quote-icon {
    color: var(--primary-color);
    opacity: 0.2;
    font-size: 24px;
    position: absolute;
    left: 0;
    top: 0;
}

#quote-text {
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 8px;
    color: var(--text-color);
    font-weight: 500;
}

#quote-author {
    font-size: 14px;
    color: var(--text-secondary);
    text-align: right;
    font-style: italic;
}

#refresh-quote {
    background-color: var(--primary-light);
    color: var(--primary-color);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    margin-left: 15px;
    flex-shrink: 0;
}

#refresh-quote:hover {
    background-color: var(--primary-color);
    color: white;
    transform: rotate(180deg);
}

#refresh-quote i {
    font-size: 18px;
}

@keyframes quoteChange {
    0% { opacity: 1; transform: translateY(0); }
    20% { opacity: 0; transform: translateY(-10px); }
    80% { opacity: 0; transform: translateY(10px); }
    100% { opacity: 1; transform: translateY(0); }
}

.quote-changing #quote-text,
.quote-changing #quote-author {
    animation: quoteChange 0.8s ease-out;
}

/* 分类导航 */
.category-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 20px 0;
    padding: 0;
}

.category-btn {
    background-color: var(--card-bg-color);
    border: none;
    border-radius: 18px;
    padding: 6px 12px;
    font-size: 14px;
    color: var(--text-color);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
    backdrop-filter: blur(var(--backdrop-blur));
    -webkit-backdrop-filter: blur(var(--backdrop-blur));
}

.category-btn i {
    font-size: 16px;
}

.category-btn:hover {
    background-color: var(--primary-light);
    color: var(--primary-color);
    transform: translateY(-2px);
}

.category-btn.active {
    background-color: var(--primary-color);
    color: white;
}

/* 网站网格 */
.website-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    width: 100%;
    margin: 20px 0;
}

.website-card {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    text-align: left;
    transition: var(--transition);
    cursor: pointer;
    height: 100%;
    padding: 15px;
    background-color: var(--card-bg-color);
    border-radius: var(--border-radius);
    position: relative;
    backdrop-filter: blur(var(--backdrop-blur));
    -webkit-backdrop-filter: blur(var(--backdrop-blur));
}

.website-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--gradient);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
    z-index: -1;
}

.website-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.website-card:hover::after {
    transform: scaleX(1);
}

.website-icon {
    width: 42px;
    height: 42px;
    background-color: var(--primary-light);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.website-card:hover .website-icon {
    transform: scale(1.1);
}

.website-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.website-name {
    font-weight: 600;
    margin-top: 8px;
    margin-bottom: 4px;
    color: var(--text-color);
    font-size: 15px;
}

.website-description {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.website-category {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: var(--primary-light);
    color: var(--primary-color);
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 10px;
    font-weight: 500;
}

.no-result {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 0;
    color: var(--text-secondary);
}

.no-result i {
    font-size: 50px;
    margin-bottom: 15px;
    display: block;
    color: var(--primary-color);
    opacity: 0.7;
}

.no-result-tip {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 10px;
    font-style: italic;
    opacity: 0.8;
}

/* 响应式设计 */
@media (max-width: 768px) {
    body {
        padding: 0 15px;
    }
    
    .website-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 15px;
    }
    
    .daily-quote {
        padding: 12px 15px;
    }
    
    header {
        padding: 0;
    }
    
    /* 自定义分类编辑模态窗口响应式 */
    .modal-content {
        width: 95%;
        max-width: 450px;
    }
    
    .modal-header h3 {
        font-size: 16px;
    }
    
    .category-tools {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .data-operation {
        width: 100%;
        justify-content: space-between;
    }
    
    .export-data-btn, .import-data-btn {
        padding: 6px 10px;
        font-size: 13px;
    }
    
    .sort-sites-btn {
        width: 100%;
        justify-content: center;
    }
    
    .drag-instructions {
        font-size: 13px;
        padding: 8px 10px;
    }
    
    #custom-sites-count {
        font-size: 13px;
        padding: 5px 10px;
    }
    
    .custom-site-item {
        padding: 12px;
    }
    
    .site-info span {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .website-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 12px;
    }
    
    .main-content {
        padding: 0 10px 15px;
    }
    
    .website-icon {
        width: 42px;
        height: 42px;
        font-size: 20px;
    }
    
    .website-name {
        font-size: 14px;
    }
    
    .website-description {
        font-size: 12px;
    }
    
    header {
        padding: 0 10px;
    }
    
    /* 更小屏幕下的自定义分类编辑模态窗口 */
    .modal-content {
        width: 98%;
    }
    
    .modal-header {
        padding: 12px 15px;
    }
    
    .modal-body {
        padding: 15px;
    }
    
    .custom-sites-container {
        padding: 10px;
    }
    
    .drag-handle i {
        font-size: 18px;
    }
    
    .delete-site-btn {
        padding: 6px;
    }
    
    .site-info img {
        width: 16px;
        height: 16px;
        margin-right: 8px;
    }
    
    .empty-state i {
        font-size: 50px;
    }
    
    .empty-state p {
        font-size: 14px;
    }
    
    .primary-btn {
        padding: 8px 15px;
        font-size: 14px;
    }
    
    /* 调整分类导航显示 */
    .category-nav {
        gap: 8px;
        margin: 15px 0;
    }
    
    .category-btn {
        padding: 5px 10px;
        font-size: 13px;
    }
    
    .category-btn i {
        font-size: 15px;
    }
    
    /* 搜索框自适应 */
    #search-input {
        height: 38px;
        font-size: 14px;
    }
}

/* 极小屏幕设备 */
@media (max-width: 360px) {
    .website-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 10px;
    }
    
    .modal-header h3 {
        font-size: 15px;
    }
    
    .category-btn {
        padding: 4px 8px;
        font-size: 12px;
    }
    
    .export-data-btn, .import-data-btn {
        padding: 5px 8px;
        font-size: 12px;
    }
    
    .export-data-btn i, .import-data-btn i {
        font-size: 15px;
    }
    
    .custom-site-item {
        padding: 10px;
    }
    
    .drag-handle {
        margin-right: 8px;
    }
    
    .site-info span {
        font-size: 13px;
    }
    
    #custom-category-name {
        padding: 8px 12px;
    }
}

/* 添加网站按钮 */
.add-website-btn {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 20px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    margin-right: 10px;
}

.add-website-btn:hover {
    background-color: var(--primary-light);
    color: var(--primary-color);
}

/* 弹窗样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
    overflow-y: auto;
    padding: 20px 0;
}

.modal.active {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: var(--card-bg-color);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
    animation: slideIn 0.3s ease;
    backdrop-filter: blur(15px); /* 弹窗使用更强的模糊效果 */
    -webkit-backdrop-filter: blur(15px);
    display: flex;
    flex-direction: column;
    position: relative;
}

@keyframes slideIn {
    from { transform: translateY(-30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--card-bg-color);
    z-index: 5;
    position: sticky;
    top: 0;
}

.modal-header h3 {
    margin: 0;
    color: var(--text-color);
    font-size: 18px;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.close-btn:hover {
    color: var(--text-color);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(90vh - 120px); /* 减去头部和底部的高度 */
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: var(--text-color);
    font-weight: 500;
    font-size: 14px;
}

.form-group input, 
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--background-color);
    color: var(--text-color);
    font-size: 14px;
    transition: var(--transition);
}

.form-group input:focus, 
.form-group select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
    outline: none;
}

.submit-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 15px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    width: 100%;
    transition: var(--transition);
}

.submit-btn:hover {
    background: var(--gradient);
}

/* 删除原有的删除按钮样式 */
.delete-website-btn {
    display: none; /* 隐藏原有的删除按钮 */
}

/* 添加右键菜单样式 */
.context-menu {
    position: fixed;
    background: var(--card-bg-color);
    border-radius: 8px;
    padding: 5px 0;
    min-width: 150px;
    box-shadow: var(--box-shadow);
    z-index: 1000;
    backdrop-filter: blur(var(--backdrop-blur));
    -webkit-backdrop-filter: blur(var(--backdrop-blur));
    border: 1px solid var(--border-color);
}

.context-menu-item {
    padding: 8px 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-color);
    transition: var(--transition);
    font-size: 14px;
}

.context-menu-item:hover {
    background-color: var(--primary-light);
    color: var(--primary-color);
}

.context-menu-item.edit {
    color: var(--primary-color);
}

.context-menu-item.edit:hover {
    background-color: var(--primary-light);
    color: var(--primary-color);
}

.context-menu-item.delete {
    color: #ff5757;
    border-top: 1px solid var(--border-color);
}

.context-menu-item.delete:hover {
    background-color: rgba(255, 87, 87, 0.1);
    color: #ff5757;
}

.context-menu-item i {
    font-size: 16px;
}

.default-category-btn, .wallpaper-btn {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 20px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    margin-left: 10px;
}

.default-category-btn:hover, .wallpaper-btn:hover {
    background-color: var(--primary-light);
    color: var(--primary-color);
}

.modal-desc {
    margin-bottom: 15px;
    color: var(--text-secondary);
    font-size: 14px;
}

.header-right {
    display: flex;
    align-items: center;
    min-width: 100px;
}

/* 天气显示区域样式已移除 */

/* 天气显示区域 */
/* .weather-container {
    display: flex;
    align-items: center;
    background-color: var(--card-bg-color);
    border-radius: 12px;
    padding: 5px 12px;
    margin-left: 15px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.weather-container:hover {
    background-color: var(--primary-light);
    transform: translateY(-2px);
}

.weather-icon {
    font-size: 22px;
    color: var(--primary-color);
    margin-right: 8px;
}

.weather-info {
    display: flex;
    flex-direction: column;
}

#weather-location {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-color);
}

#weather-text {
    font-size: 12px;
    color: var(--text-secondary);
}

@media (max-width: 768px) {
    .weather-container {
        padding: 4px 8px;
        margin-left: 8px;
    }
    
    .weather-icon {
        font-size: 18px;
        margin-right: 5px;
    }
    
    #weather-location {
        font-size: 12px;
    }
    
    #weather-text {
        font-size: 11px;
    }
} */

/* 壁纸预览区域 */
.wallpaper-preview-container {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 15px;
}

.wallpaper-preview {
    width: 100%;
    height: 150px;
    border-radius: 8px;
    border: 2px dashed var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    background-size: cover;
    background-position: center;
    overflow: hidden;
    position: relative;
}

.wallpaper-preview i {
    font-size: 32px;
    margin-bottom: 10px;
}

.wallpaper-preview.has-image i,
.wallpaper-preview.has-image span {
    display: none;
}

/* 文件上传按钮 */
.wallpaper-file-input {
    display: none;
}

.file-input-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.file-input-btn {
    background-color: var(--background-color);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 8px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: var(--transition);
}

.file-input-btn:hover {
    background-color: var(--primary-light);
    color: var(--primary-color);
}

.file-name {
    font-size: 14px;
    color: var(--text-secondary);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 透明度滑块 */
.opacity-slider-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.opacity-slider {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--border-color);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

.opacity-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
}

.opacity-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: none;
}

#opacity-value {
    font-size: 14px;
    color: var(--text-secondary);
    min-width: 40px;
    text-align: right;
}

/* 壁纸操作按钮 */
.wallpaper-options {
    display: flex;
    gap: 10px;
}

.remove-btn {
    background-color: var(--border-color);
    color: var(--text-color);
    border: none;
    border-radius: 8px;
    padding: 10px 15px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    flex: 1;
}

.remove-btn:hover {
    background-color: #ff5757;
    color: white;
}

/* 壁纸背景 */
.wallpaper-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: opacity 0.5s ease;
}

/* 页脚 */
/* .footer {
    text-align: center;
    color: #777;
    padding: 15px 0;
    font-size: 18px;
    font-weight: bold;
    position: fixed;
    bottom: 20px;
    left: 0;
    width: 100%;
    z-index: 10;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.7);
} */

/* 其他输入框在弹窗中也允许输入 */
.modal input,
.modal textarea,
.modal select {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    cursor: text;
}

/* 图标预览区域样式 */
.icon-preview {
    display: flex;
    align-items: center;
    margin-top: 5px;
    min-height: 32px;
}

.icon-preview img {
    border-radius: 4px;
    background-color: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-right: 8px;
}

.icon-preview span {
    font-size: 0.85rem;
    color: var(--secondary-text-color);
}

/* 用户自定义分类按钮样式 */
.user-custom-category {
    position: relative;
    background-color: var(--primary-color-light);
    border: 1px solid var(--primary-color);
    font-weight: 500;
    padding-right: 28px; /* 为编辑图标留出空间 */
    white-space: nowrap; /* 防止文本换行 */
    text-overflow: ellipsis; /* 如果文本溢出，显示省略号 */
    max-width: 200px; /* 设置最大宽度 */
    display: flex;
    align-items: center;
}

.category-content {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-custom-category.active {
    background-color: var(--primary-color);
}

.edit-category-icon {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    font-size: 14px;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.user-custom-category:hover .edit-category-icon {
    opacity: 1;
}

/* 自定义分类网站列表 */
.custom-sites-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px;
    margin-top: 8px;
}

.custom-sites-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--text-color);
}

.drag-instructions {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--secondary-color);
    margin-bottom: 8px;
    padding: 5px;
    background-color: var(--primary-light);
    border-radius: 4px;
    border-left: 3px solid var(--primary-color);
}

.drag-instructions i {
    font-size: 16px;
}

.sort-sites-btn {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--secondary-color);
    font-size: 13px;
    padding: 3px 8px;
    border-radius: 4px;
    transition: var(--transition);
    background-color: var(--card-bg-color);
    border: 1px solid var(--border-color);
}

.sort-sites-btn:hover {
    color: var(--primary-color);
    background-color: var(--primary-light);
}

.sort-menu-container {
    background-color: var(--card-bg-color);
    border-radius: 8px;
    box-shadow: var(--box-shadow);
    border: 1px solid var(--border-color);
    overflow: hidden;
    min-width: 150px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.sort-menu {
    display: flex;
    flex-direction: column;
}

.sort-option {
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.sort-option:hover {
    background-color: var(--primary-light);
    color: var(--primary-color);
}

.empty-list-msg {
    text-align: center;
    color: var(--secondary-text-color);
    padding: 20px 0;
    font-style: italic;
}

.custom-site-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #eee;
    background-color: white;
    transition: all 0.3s ease;
    opacity: 1;
    transform: translateX(0);
}

.custom-site-item:last-child {
    border-bottom: none;
}

.custom-site-item:hover {
    background-color: var(--primary-light);
}

.custom-site-item.dragging {
    opacity: 0.5;
    background-color: var(--primary-light);
}

.drag-handle {
    cursor: grab;
    color: var(--secondary-color);
    margin-right: 8px;
    opacity: 0.5;
    transition: var(--transition);
}

.custom-site-item:hover .drag-handle {
    opacity: 0.8;
}

.custom-site-item .site-icon {
    width: 32px;
    height: 32px;
    margin-right: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.custom-site-item .site-icon img {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    object-fit: contain;
}

.custom-site-item .site-icon i {
    font-size: 24px;
    color: var(--primary-color);
}

.custom-site-item .site-info {
    flex-grow: 1;
    overflow: hidden;
}

.custom-site-item .site-name {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.custom-site-item .site-url {
    font-size: 0.85rem;
    color: var(--secondary-text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.site-actions {
    display: flex;
    gap: 5px;
    margin-left: 10px;
}

.site-action-btn {
    background: none;
    border: none;
    color: var(--secondary-text-color);
    padding: 5px;
    cursor: pointer;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.site-action-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.visit-site-btn:hover {
    color: var(--primary-color);
}

.remove-site-btn:hover {
    color: #f44336;
}

/* 添加到自定义分类的菜单项 */
.context-menu-item.add-to-custom i {
    color: #FFB74D;
}

/* 添加网站分类选择框样式 - 隐藏下拉三角图标 */
#website-category {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: none;
    padding-right: 8px;
    cursor: default;
    background-color: #f0f0f0;
    color: #666;
}

/* 解决Firefox浏览器中的特殊情况 */
#website-category::-ms-expand {
    display: none;
}

/* 分类提示文字样式 */
.category-hint {
    font-size: 12px;
    color: #666;
    font-weight: normal;
    font-style: italic;
}

/* 分类工具区域样式 */
.category-tools {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.data-operation {
    display: flex;
    gap: 10px;
}

.export-data-btn, .import-data-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 14px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    cursor: pointer;
    transition: all 0.2s ease;
}

.export-data-btn:hover, .import-data-btn:hover {
    background: #e0e0e0;
    border-color: #ccc;
}

.export-data-btn i, .import-data-btn i {
    font-size: 16px;
}

.category-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 10px;
}

.sort-option {
    display: flex;
    align-items: center;
}

/* 自定义分类编辑模态窗口样式 */
.custom-sites-container {
    margin-top: 15px;
    background-color: rgba(255, 255, 255, 0.5);
    padding: 15px;
    border-radius: 8px;
}

.custom-sites-list {
    max-height: 400px;
    overflow-y: auto;
    margin-top: 10px;
    border: 1px solid #eee;
    border-radius: 10px;
    background-color: #f9f9f9;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.05);
}

.custom-site-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #eee;
    background-color: white;
    transition: all 0.3s ease;
}

.custom-site-item:last-child {
    border-bottom: none;
}

.custom-site-item:hover {
    background-color: #f5f9ff;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.custom-site-item.dragging {
    opacity: 0.7;
    background-color: #f0f8ff;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.drag-handle {
    margin-right: 12px;
    color: #aaa;
    cursor: move;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.drag-handle:hover {
    background-color: #f0f0f0;
    color: #666;
}

.drag-handle i {
    font-size: 20px;
}

.site-info {
    display: flex;
    align-items: center;
    flex-grow: 1;
}

.site-info img {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.site-info span {
    font-weight: 500;
    color: #333;
}

.delete-site-btn {
    background: none;
    border: none;
    color: #e74c3c;
    cursor: pointer;
    padding: 8px;
    opacity: 0.6;
    transition: all 0.2s ease;
    border-radius: 50%;
}

.delete-site-btn:hover {
    opacity: 1;
    background-color: rgba(231, 76, 60, 0.1);
    transform: scale(1.1);
}

.category-name-edit {
    margin-bottom: 20px;
}

#custom-category-name {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

#custom-category-name:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

#custom-sites-count {
    color: #666;
    font-size: 14px;
    margin: 10px 0;
    background-color: #f5f5f5;
    padding: 6px 12px;
    border-radius: 20px;
    display: inline-block;
}

.drag-instructions {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
    padding: 10px 15px;
    background-color: #f0f7ff;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.drag-instructions i {
    font-size: 18px;
    color: var(--primary-color);
}

.category-tools {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 0 5px;
}

.data-operation {
    display: flex;
    gap: 10px;
}

.export-data-btn, .import-data-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 15px;
    border-radius: 6px;
    font-size: 14px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.export-data-btn:hover, .import-data-btn:hover {
    background: #f0f0f0;
    border-color: #ccc;
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
}

.export-data-btn i, .import-data-btn i {
    font-size: 18px;
}

.export-data-btn {
    color: #2e7d32;
}

.import-data-btn {
    color: #1565c0;
}

.sort-sites-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    color: #555;
    transition: all 0.2s ease;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.sort-sites-btn:hover {
    background-color: var(--primary-light);
    color: var(--primary-color);
    border-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
}

.sort-sites-btn i {
    font-size: 16px;
}

.modal-footer {
    padding: 15px 20px;
    display: flex;
    justify-content: flex-end;
    border-top: 1px solid var(--border-color);
}

.primary-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.primary-btn:hover {
    background: var(--gradient);
    box-shadow: 0 4px 10px rgba(67, 97, 238, 0.3);
}

/* 自定义分类空状态 */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: #999;
    text-align: center;
}

.empty-state i {
    font-size: 60px;
    margin-bottom: 20px;
    color: #ddd;
}

.empty-state p {
    font-size: 15px;
    line-height: 1.5;
    max-width: 250px;
}

/* 删除动画效果 */
.custom-site-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #eee;
    background-color: white;
    transition: all 0.3s ease;
    opacity: 1;
    transform: translateX(0);
}

/* 模态窗口淡入效果 */
.modal {
    transition: opacity 0.3s ease;
}

/* 增强拖动时的视觉反馈 */
.custom-site-item.drag-over-top {
    border-top: 2px solid var(--primary-color);
}

.custom-site-item.drag-over-bottom {
    border-bottom: 2px solid var(--primary-color);
}

/* 添加鼠标手型指针 */
.custom-site-item {
    cursor: pointer;
}

.drag-handle {
    cursor: grab;
}

.drag-handle:active {
    cursor: grabbing;
}

/* 响应式设计调整 */
@media (max-width: 768px) {
    .modal {
        align-items: flex-start;
        padding: 15px 0;
    }
    
    .modal-content {
        max-height: 85vh;
    }
    
    .modal-body {
        max-height: calc(85vh - 110px);
    }
    
    .modal-footer {
        padding: 12px 15px;
    }
}

@media (max-height: 600px) {
    .modal {
        align-items: flex-start;
        padding: 10px 0;
    }
    
    .modal-content {
        max-height: 95vh;
    }
    
    .modal-header {
        padding: 10px 15px;
    }
    
    .modal-footer {
        padding: 10px 15px;
    }
    
    .modal-body {
        padding: 15px;
        max-height: calc(95vh - 100px);
    }
}

/* 自定义分类编辑模态窗口样式 */
#edit-category-modal .modal-content {
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

#edit-category-modal .modal-body {
    overflow-y: auto;
    flex: 1;
}

#edit-category-modal .modal-footer {
    border-top: 1px solid var(--border-color);
    background-color: var(--card-bg-color);
    position: sticky;
    bottom: 0;
    z-index: 5;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

#edit-category-modal .primary-btn {
    min-width: 100px;
    font-size: 15px;
} 